import {lazy} from 'react'

var Index = lazy(()=>import('../views/Index'))
var City = lazy(()=>import('../views/City'))
var Login = lazy(()=>import('../views/Login'))
var Detail = lazy(()=>import('../views/Detail'))
var NotFound = lazy(()=>import('../views/NotFound'))

var Home = lazy(()=>import('../views/Index/Home'));
var Cate = lazy(()=>import('../views/Index/Cate'));
var Gwc = lazy(()=>import('../views/Index/Gwc'));
var Mine = lazy(()=>import('../views/Index/Mine'));

//路由配置信息
export default [
    {
        path:'/index',
        name:'index',
        component: Index,
        children:[
            {
                path:'/index/home',
                name:'home',
                component: Home,
            },
            {
                path:'/index/cate',
                name:'cate',
                component: Cate,
            },
            {
                path:'/index/gwc',
                name:'gwc',
                component: Gwc,
            },
            {
                path:'/index/mine',
                name:'mine',
                component: Mine,
            },
            {
                from:'/index',
                to:'/index/home',
                redirect:true
            },
            {
                path:'*',
                component: NotFound,
            },
        ]
    },
    {
        path:'/city',
        name:'city',
        component: City,
    },
    {
        path:'/login',
        name:'login',
        component: Login,
    },
    {
        path:'/detail',
        name:'detail',
        component: Detail,
    },
    {
        from:'/',
        to:'/index',
        redirect:true
    },
    {
        path:'*',
        component: NotFound,
    },

]